home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#48 (Sep 89)
/
Zoundz Source
/
save_changes.Pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-05-08
|
1KB
|
59 lines
unit save_changes;
interface
function D_save_changes: integer;
implementation
const {These are the item numbers for controls in the Dialog}
I_Yes = 1;
I_Cancel = 2;
I_No = 3;
I_x = 4;
var
ExitDialog: boolean; {Flag used to exit the Dialog}
DoubleClick: boolean; {Flag to say that a double click on a list happened}
MyPt: Point; {Current list selection point}
MyErr: OSErr; {OS error returned}
function D_save_changes;
var
GetSelection: DialogPtr;
tempRect: Rect;
DType: Integer;
DItem: Handle;
itemHit: Integer;
procedure Refresh_Dialog; {Refresh the dialogs non-controls}
var
rTempRect: Rect; {Temp rectangle used for drawing}
begin
SetPort(GetSelection); {Point to our dialog window}
GetDItem(GetSelection, I_Yes, DType, DItem, tempRect);
PenSize(3, 3);
InsetRect(tempRect, -4, -4);
FrameRoundRect(tempRect, 16, 16);
PenSize(1, 1);
end;
begin {Start of dialog handler}
GetSelection := GetNewDialog(3, nil, Pointer(-1));
ShowWindow(GetSelection);
SelectWindow(GetSelection);
SetPort(GetSelection);
Refresh_Dialog;
ExitDialog := FALSE;
repeat
ModalDialog(nil, itemHit);
D_save_changes := itemHit;
if (ItemHit = I_Yes) or (ItemHit = I_Cancel) or (ItemHit = I_No) then
ExitDialog := TRUE;
until ExitDialog;
DisposDialog(GetSelection);
end;
end. {End of unit}